package tp2.algocity.modelo;

public class Posicion {
	private int posX;
	private int posY;
	
	public Posicion(int x, int y){
		posX = x;
		posY = y;
	}
	
	public void setPosX(int x){
		posX = x;
	}
	
	public void setPosY(int y){
		posY = y;
	}
	
	public void setPosicion(int x, int y){
		posX = x;
		posY = y;
	}
	
	public int getPosX(){
		return posX;
	}
	
	public int getPosY(){
		return posY;
	}
	
	@Override
	public boolean equals(Object o){
		if (o == null) return false;
		if (o == this)return true;
		if (getClass() != o.getClass()) return false;
		
		Posicion unaPosicion = (Posicion)o;
		if (unaPosicion.getPosX() != this.posX) return false;
		if (unaPosicion.getPosY() != this.posY) return false;
		
		return true;
	}
	
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + posX;
        result = prime * result + posY;
        return result;
    }
}
